{% extends "main/base.html" %}
{% load static i18n %}
{% block title %}{% trans '添加收支类型' %}{% endblock %}
{% block this_css %}
<link type="text/css" href="{% static 'flatlab/css/bootstrap-select.min.css' %}" rel="stylesheet">
{% endblock %}
{% block content %}
<section class="col-lg-offset-3 col-lg-6">
    <section class="panel">
        <header class="panel-heading">
            {% trans "添加收支类型" %}
            {% if form.errors %}
            <p>{% trans "您提交的数据有误,请认真检查!" %}</p>
            {% endif %}
            {{ form.non_field_errors }}
        </header>
        <div class="panel-body">
            <form method="post" class="form-horizontal" action="{{ request.path }}?next={{ request.GET.next }}">{% csrf_token %}
                <div class="form-group">
                    <div class="col-lg-2">{{ form.in_out_type.label_tag }}</div>
                    <div class="col-lg-10">{{ form.in_out_type }}{{ form.in_out_date.errors }}</div>
                </div>
                <div class="form-group">
                    <div class="col-lg-2">{{ form.is_out.label_tag }}</div>
                    <div class="col-lg-10">
                        <div class="switch switch-square"
                            data-on-label="<i class=' fa fa-check'></i>"
                            data-off-label="<i class='fa fa-times'></i>">
                            {{ form.is_out }}
                        </div>
                        {{ form.is_out.errors }}
                    </div>
                </div>
                <div class="form-group" align="right">
                    <div class="col-lg-12">
                        <button type="submit" class="btn btn-primary">{% trans "提交" %}</button>
                    </div>
                </div>
            </form>
        </div>
    </section>
</section>
{% endblock %}
{% block this_js %}
<script type="text/javascript" src="{% static 'flatlab/js/bootstrap-select.min.js' %}"></script>
<script type="text/javascript" src="{% static 'flatlab/js/bootstrap-switch.js' %}"></script>
{% endblock %}